
public class finalSchedule {

	private int defaultMeetTime = 30;
	private static int inaRow = 2;
	public finalSchedule(int minMeetTime){
		
		if(minMeetTime%15 ==0){
			defaultMeetTime = minMeetTime;
			inaRow = defaultMeetTime/15;
		}
		
	}
	public static void main(String[] args){
		booleanSchedule boolAdviser = new booleanSchedule();
		booleanSchedule boolStudent = new booleanSchedule();
		milTimeSchedule student = new milTimeSchedule();
		milTimeSchedule adviser = new milTimeSchedule();
		/*Sets available times for One day. Will need to do this whole method for each day*/
		student.setAvailable(800, 830);
		student.setAvailable(915, 1000);
		boolStudent.generateSchedule(student);
		
		adviser.setAvailable(800, 900);
		adviser.setAvailable(930, 1000);
		boolAdviser.generateSchedule(adviser);
		// they should overlap at 800-830
		
		
		booleanSchedule resultSchedule = new booleanSchedule();
		for (int count=0; count<56; count++){
			if(boolStudent.getAvailable(count) == true && boolAdviser.getAvailable(count)==true){
				resultSchedule.setAvailable(count);
			}			
		}
		/*Will need a boolSchedule to milTime Schedule here*/
		
		
		compareToMinTime(resultSchedule);
	}
	/*This method should go through the resulting schedule and check to see if the times
	set are less than the minMeetTime. If they are, set those value 
	Use the getMilTimeSchedule method to do this. */
	public static booleanSchedule compareToMinTime(booleanSchedule firstResult){
		int index = 0;
        while (firstResult.getAvailable(index) == false)
        {
                index++;
        }
        int startIndex = index;
        
        while(firstResult.getAvailable(index) == true)
        {
                index++;
        }
        int endIndex = index;
        //for example 800 -830 true would mean startIndex = 0 and endIndex = 1
        //if the difference is less than in a row, eliminate both
        if((endIndex-startIndex)<inaRow-1){
        	for (int i = startIndex; i<endIndex; i++){
        		firstResult.setUnavailable(i);
        	}
        }
        return firstResult;
	}
	//Create method to check what time class ends. If its at 1015, add buffer time, if its at 1050, 
	//no buffertime needed. 
	private void bufferTime(){
		
	}
	
	
}
